<!DOCTYPE html>
<html>
<head>
    <title>奖惩</title>
    <script src="/statics/libs/jquery.min.js"></script>
    <script src="/statics/libs/vue.min.js"></script>
    <link rel="stylesheet" href="/statics/plugins/element-ui/lib/theme-chalk/index.css">
    <script src="/statics/plugins/element-ui/lib/index.js"></script>
</head>
<style>
    /*解决Vue刷新一瞬间出现样式未加载完或者出现Vue代码问题*/
    [v-cloak] {
        display: none;
    }
</style>

<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <!--Form表单组件-->
        <el-form :inline="true" :model="q" class="demo-form-inline">
            <!--Form 组件中，每一个表单域由一个 Form-Item 组件构成-->
            <el-form-item>
                <el-input v-model.trim="q.name" @keyup.enter="query" placeholder="员工姓名"></el-input>
            </el-form-item>
            <!--<el-form-item>
                <el-input v-model.trim="q.idNumber" @keyup.enter="query" placeholder="身份证号"></el-input>
            </el-form-item>-->
            <el-form-item>
                <el-button @click="query">查询</el-button>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="add">新增</el-button>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="update">修改</el-button>
            </el-form-item>
            <el-form-item>
                <el-button type="danger" @click="del">删除</el-button>
            </el-form-item>
        </el-form>

        <!--table表格-->
        <el-table
                ref="multipleTable"
                :data="page.list"
                tooltip-effect="dark"
                style="width: 100%"
                @selection-change="handleSelectionChange">
            <el-table-column
                    type="selection">
            </el-table-column>


            <el-table-column
                    prop="employeeName"
                    label="员工姓名">
            </el-table-column>
            <el-table-column
                    prop="companyName"
                    label="公司名称">
            </el-table-column>
            <el-table-column
                    prop="type"
                    label="类别">
                <template slot-scope="scope">
                    <el-tag v-if="scope.row.type===0">奖励</el-tag>
                    <el-tag v-if="scope.row.type===1">惩罚</el-tag>
                </template>
            </el-table-column>
            <el-table-column
                    prop="describe"
                    label="描述">
            </el-table-column>
            <el-table-column
                    prop="createDate"
                    label="创建日期">
            </el-table-column>
<!--            <el-table-column-->
<!--                    prop=""-->
<!--                    label="操作">-->
<!--                <template slot-scope="scope">-->
<!--                    <el-link type="primary" :underline="false" @click="handleItem(scope.row.id)">操作</el-link>-->
<!--                </template>-->
<!--            </el-table-column>-->
        </el-table>

<!--        分页类Pagination Class 允许按页面浏览的链接。后端不支持分页，请求回来数据很多，放到页面中不利于浏览查找，前端做一个伪分页效果-->
        <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="page.currPage"
                :page-sizes="[5, 10, 15, 20]"
                :page-size="page.pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="page.totalCount"
                style="text-align: center">
        </el-pagination>
    </div>

    <el-card class="box-card" v-show="!showList" style="width: 35%">
        <div slot="header" class="clearfix">
            <span>{{title}}</span>
        </div>
        <el-form :model="reward" ref="ruleForm" label-width="100px" class="demo-ruleForm">
            <el-form-item label="员工" prop="employeeId">
                <el-select v-model="reward.employeeId" placeholder="请选择">
                    <el-option  v-for="item in employeeList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="创建日期" prop="createDate">
                <el-date-picker type="date" placeholder="选择日期" value-format="yyyy-MM-dd" v-model="reward.createDate"
                                style="width: 100%;"></el-date-picker>
            </el-form-item>
            <el-form-item label="类别" prop="type">
                <el-radio-group v-model="reward.type">
                    <el-radio v-for="status in statusList" :label="status.id">{{status.name}}</el-radio>
                </el-radio-group>
            </el-form-item>
            <el-form-item label="描述" prop="describe">
                <el-input type="textarea" v-model.trim="reward.describe"></el-input>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="saveOrUpdate">确定</el-button>
                <el-button @click="loadPage(false)">返回</el-button>
            </el-form-item>
        </el-form>
    </el-card>


</div>

<script src="/statics/js/modules/dev/reward.js?_${.now?long}"></script>
</body>
</html>
